<!DOCTYPE html>
<html lang="zh">

<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
  <meta content="yes" name="apple-mobile-web-app-capable" />
  <meta content="telephone=no" name="format-detection" />

  <title>苏州同济医院_同济官网在线预约</title>
  <link href="layout.css" rel="stylesheet" type="text/css" />
  <script src="js/jquery.min.js"></script>
  <script src="js/rem.js"></script>
  <style>
    table {
      table-layout: fixed;
      width: 100%;
      text-align: center;
      border-bottom: 1px solid #262d2d;
      font-weight: 700;
      font-size: 1rem;
    }

    caption {
      padding: 1.5rem 0;
      background: #00927f;
      font-size: 1.5rem;
      color: #fff;
    }

    tr {
      border-bottom: 1px solid #262d2d;
    }

    tr.odd td {
      border-top: 1px solid #d5e5e8;
    }

    th {
      background: #3fbabf;
      color: #fff;
    }

    th:first-child {
      background: #fff;
      color: #222;
      width: 7.5rem;
      border-right: 0;
    }

    th,
    td {
      padding: .2rem 0;
      height: 1.8rem;
      line-height: 1.2;
      border-right: 1px solid #d5e5e8;
      word-break: keep-all;
    }

    td:last-child {
      border-right: 0;
    }

    td a {
      color: #222;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    td span {
      font-weight: normal;
      display: inline-block;
      word-break: break-all;
      font-size: 1rem;
      transform: scale(0.5);
      line-height: 1.2rem;
      width: 200%;
      margin-top: -0.4rem;
    }

    table tr:last-child {
      border-bottom: 0;
    }

    #myTable {
      margin-bottom: 1rem;
    }

    #myTable td:nth-child(1) {
      width: 5rem;
    }

    #myTable td:nth-child(2) {
      width: 2.5rem;
    }

    .artnav {
      z-index: 300;
      max-width: 750px;
    }
  </style>
</head>

<body class="index">
  <header>
    <img class="headpic1" src="./images/logo_xcx.jpg" alt="" />
    <img class="headpic2" src="./images/ban.jpg" alt="" />
   <!--  <img class="qr" src="./images/qr.png" alt="" /> -->
  </header>

  <table class="artnav">
    <caption>同济医院特需门诊专家10月出诊信息</caption>
    <tr class="odd">
      <th>
        <div class="tks">科室</div>
      </th>
      <th>星期一</th>
      <th>星期二</th>
      <th>星期三</th>
      <th>星期四</th>
      <th>星期五</th>
      <th>星期六</th>
      <th>星期日</th>
    </tr>
  </table>
  <div id="box">
    <table id="myTable"></table>
  </div>
  <img class="allied" src="./images/dw.png" alt="" />
  <div class="bottom">
    <a class="home" href="/gh/list_xcx.html">
      <img src="./images/home.png" alt=""> 首 页</a>
    <a class="tx" href="/gh/list_xcx.html">
      <img src="./images/tx.png" alt=""> 特需专家号</a>
    <a class="pt" href="/gh/list.html">
      <img src="./images/pt.png" alt=""> 专科专诊号</a>
  </div>
  <script src="js/zjList.js"></script>
  <script>
    var tag = ''
    var url = window.location.href
    var dz_url = url.split('#')[0] //获取#之前的字符串
    var cs = dz_url.split('?')[1] //获取?之后的参数字符串

    if (cs) {
      var cs_arr = cs.split('&') //参数字符串分割为数组
      var cs = {}
      for (var i = 0; i < cs_arr.length; i++) {
        //遍历数组，拿到json对象
        cs[cs_arr[i].split('=')[0]] = cs_arr[i].split('=')[1]
      }
      if (cs.tag) {
        $('.home').attr("href", "/gh/list_xcx.html?tag=" + cs.tag)
        $('.pt').attr("href", "/gh/list.html?tag=" + cs.tag)
        $('.tx').attr("href", "/gh/list_xcx.html?tag=" + cs.tag)
      }
    } else {
      cs = {}
    }

    function week() {
      var c = ''
      for (var d = 1; d <= 7; d++) {
        c += '<td class="week_' + d + '"></td>'
      }
      return c
    }
    for (var i = 0; i < department.length; i++) {
      var tableC =
        '<tr id="am_' + i + '"><td rowspan="2"><a href="/gh/ks_tx.html?tag=' + cs.tag + '&ks='
        + dpm[i] + '">' + department[i]
        + '</a></td><td>上午</td>' + week() + '</tr>'
        + '<tr class="odd" id="pm_' + i + '"><td>下午</td>' + week() + '</tr>'
      $('#myTable').append(tableC)
      var zjLists;
      for (zjLists in zjList) {
        var zjs = zjList[zjLists]
        //如果存在排班且科室相符
        if (zjs[4] && department[i] == zjs[1]) {
          var textHtml = '<a href="/gh/index_tx.html?tag=' + cs.tag + '&zj=' + zjLists + '">' +
            zjs[0] + '<br><span>' + zjs[5] + '</span></a>'
          var hDay = zjs[3]
          if (hDay.indexOf('上午') != -1 || hDay.indexOf('下午') != -1) {
            var zjWeek = parseInt(zjs[4])
            var zDays = zjs[4].split(';')
            var NumA = $('#am_' + i).children('td')
            var NumB = $('#pm_' + i).children('td')
            if (zDays.length > 1) {
              for (var d = 0; d < zDays.length; d++) {
                zjWeek = parseInt(zDays[d])
                if (hDay.split('/').length > 1) {
                  if (d == 0) {
                    isAPm(hDay, NumA[zjWeek + 1], '上午', textHtml)
                  } else if (d == 1) {
                    isAPm(hDay, NumB[zjWeek], '下午', textHtml)
                  }
                } else {
                  isAPm(hDay, NumA[zjWeek + 1], '上午', textHtml)
                  isAPm(hDay, NumB[zjWeek], '下午', textHtml)
                }
              }
            } else {
              isAPm(hDay, NumA[zjWeek + 1], '上午', textHtml)
              isAPm(hDay, NumB[zjWeek], '下午', textHtml)
            }
          }
        } else if (department[i] == zjs[1]) {
          //科室相符未排班，隐藏
          $('#am_' + i).hide()
          $('#pm_' + i).hide()
        }
      }
    }
    function isAppend(Num, textHtml) {
      //一个半日内有两位坐诊专家则追加
      if (!Num.innerHTML) {
        Num.innerHTML = textHtml
      } else {
        $(textHtml).appendTo(Num)
      }
    }
    function isAPm(hDay, Num, text, textHtml) {
      if (hDay.indexOf(text) != -1) {
        isAppend(Num, textHtml)
      }
    }
    $("img").on("load", function () {
      //var oTop = $(".artnav").offset().top
      var oTop = $(".headpic1").height() + $(".headpic2").height()
      var sTop = 0;
      $(window).scroll(function () {
        sTop = $(this).scrollTop();
        // console.log(sTop + "--" + oTop);
        if (sTop >= oTop) {
          $(".artnav").css({ "position": "fixed", "top": "0" });
        } else {
          $(".artnav").css({ "position": "static" });
        }
      });
    });
  </script>
</body>

</html>